package com.bytecodezz.app.learn3

import android.content.Context
import android.opengl.GLSurfaceView
import android.util.AttributeSet

class DrawSurfaceView(context: Context, attrs: AttributeSet?) : GLSurfaceView(context, attrs) {
    private val mNativeRenderer: NativeRenderer
    private val mDrawRenderer: DrawRenderer

    constructor(context: Context) : this(context, null) {}

    init {
        setEGLContextClientVersion(3)
        mNativeRenderer = NativeRenderer()
        mDrawRenderer = DrawRenderer(mNativeRenderer)
        setEGLContextClientVersion(3)
        setRenderer(mDrawRenderer)
        renderMode = RENDERMODE_CONTINUOUSLY
    }


    fun getNativeRenderer(): NativeRenderer {
        return mNativeRenderer
    }

    fun getDrawRenderer(): DrawRenderer {
        return mDrawRenderer
    }
}